package net.xxcl.kygl.service;

import java.util.List;
import net.xxcl.kygl.mapper.MessageMapper;
import net.xxcl.kygl.pojo.Criteria;
import net.xxcl.kygl.pojo.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional()
public class MessageService {
    @Autowired
    private MessageMapper messageMapper;

    private static final Logger logger = LoggerFactory.getLogger(MessageService.class);

    public int countByExample(Criteria example) {
        int count = this.messageMapper.countByExample(example);
        logger.debug("count: {}", count);
        return count;
    }

    public Message selectByPrimaryKey(Integer id) {
        return this.messageMapper.selectByPrimaryKey(id);
    }

    public List<Message> selectByExample(Criteria example) {
        return this.messageMapper.selectByExample(example);
    }

    public int deleteByPrimaryKey(Integer id) {
        return this.messageMapper.deleteByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(Message record) {
        return this.messageMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(Message record) {
        return this.messageMapper.updateByPrimaryKey(record);
    }

    public int deleteByExample(Criteria example) {
        return this.messageMapper.deleteByExample(example);
    }

    public int updateByExampleSelective(Message record, Criteria example) {
        return this.messageMapper.updateByExampleSelective(record, example);
    }

    public int updateByExample(Message record, Criteria example) {
        return this.messageMapper.updateByExample(record, example);
    }

    public int insert(Message record) {
        return this.messageMapper.insert(record);
    }

    public int insertSelective(Message record) {
        return this.messageMapper.insertSelective(record);
    }
}